/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseWorkFlowHistoryEntity.cs
*        创建系统时间:       2012/11/2 19:07:04
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;

    [Serializable]
    public class BaseWorkFlowHistoryEntity
    {
        public string AuditDepartmentFullName;
        public string AuditDepartmentID;
        public string AuditIdea;
        public string AuditState;
        public string AuditUserFullName;
        public string AuditUserID;
        public string CreateDate;
        public string CreateUserFullName;
        public string CreateUserID;
        public string Description;
        public bool Enabled;
        public string FlowID;
        public string ID;
        public string ModifyDate;
        public string ModifyUserID;
        public string SortCode;
        public string StepID;

        public BaseWorkFlowHistoryEntity()
        {
            this.ID = string.Empty;
            this.FlowID = string.Empty;
            this.StepID = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.SortCode = string.Empty;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyDate = string.Empty;
        }

        public BaseWorkFlowHistoryEntity(DataRow dataRow)
        {
            this.ID = string.Empty;
            this.FlowID = string.Empty;
            this.StepID = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.SortCode = string.Empty;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyDate = string.Empty;
            this.GetFrom(dataRow);
        }

        public BaseWorkFlowHistoryEntity(DataTable dataTable)
        {
            this.ID = string.Empty;
            this.FlowID = string.Empty;
            this.StepID = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.SortCode = string.Empty;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyDate = string.Empty;
            this.GetFrom(dataTable);
        }

        public void ClearProperty()
        {
            this.ID = string.Empty;
            this.StepID = string.Empty;
            this.FlowID = string.Empty;
            this.AuditUserID = string.Empty;
            this.AuditUserFullName = string.Empty;
            this.AuditDepartmentID = string.Empty;
            this.AuditDepartmentFullName = string.Empty;
            this.AuditIdea = string.Empty;
            this.AuditState = string.Empty;
            this.SortCode = string.Empty;
            this.Enabled = false;
            this.Description = string.Empty;
            this.CreateUserID = string.Empty;
            this.CreateUserFullName = string.Empty;
            this.CreateDate = string.Empty;
            this.ModifyUserID = string.Empty;
            this.ModifyDate = string.Empty;
        }

        public BaseWorkFlowHistoryEntity GetFrom(DataRow dataRow)
        {
            this.ID = dataRow[BaseWorkFlowHistoryTable.FieldID].ToString();
            this.StepID = dataRow[BaseWorkFlowHistoryTable.FieldStepID].ToString();
            this.FlowID = dataRow[BaseWorkFlowHistoryTable.FieldFlowID].ToString();
            this.AuditUserID = dataRow[BaseWorkFlowHistoryTable.FieldAuditUserID].ToString();
            this.AuditUserFullName = dataRow[BaseWorkFlowHistoryTable.FieldAuditUserFullName].ToString();
            this.AuditDepartmentID = dataRow[BaseWorkFlowHistoryTable.FieldAuditDepartmentID].ToString();
            this.AuditDepartmentFullName = dataRow[BaseWorkFlowHistoryTable.FieldAuditDepartmentFullName].ToString();
            this.AuditIdea = dataRow[BaseWorkFlowHistoryTable.FieldAuditIdea].ToString();
            this.AuditState = dataRow[BaseWorkFlowHistoryTable.FieldAuditState].ToString();
            this.SortCode = dataRow[BaseWorkFlowHistoryTable.FieldSortCode].ToString();
            this.Enabled = dataRow[BaseWorkFlowHistoryTable.FieldEnabled].ToString() == "1";
            this.Description = dataRow[BaseWorkFlowHistoryTable.FieldDescription].ToString();
            this.CreateUserID = dataRow[BaseWorkFlowHistoryTable.FieldCreateUserID].ToString();
            this.CreateDate = dataRow[BaseWorkFlowHistoryTable.FieldCreateDate].ToString();
            this.ModifyUserID = dataRow[BaseWorkFlowHistoryTable.FieldModifyUserID].ToString();
            this.CreateUserFullName = dataRow[BaseWorkFlowHistoryTable.FieldCreateUserFullName].ToString();
            this.ModifyDate = dataRow[BaseWorkFlowHistoryTable.FieldModifyDate].ToString();
            return this;
        }

        public BaseWorkFlowHistoryEntity GetFrom(DataTable dataTable)
        {
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }
    }
}